package com.samuel.bean;


import com.samuel.el.AppIEConfig;
import com.samuel.el.ElConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

/**
 * @date:2017/11/21
 * @time: 11:46
 * @author:zhaoyang
 * @desc:启动Spring
 **/
public class BeanMain {


    public static void main(String[] args) {

        // 获取Spring注解配置类的上下文
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(WayConfig.class);

        System.out.println("----------------");

        BeanWayService beanWayService = context.getBean(BeanWayService.class);
        JSR250WayService jsr250WayService = context.getBean(JSR250WayService.class);

        //关闭上下文
        context.close();
    }

}
